home *** CD-ROM | disk | FTP | other *** search
- #define LEFT_BUTTON 0x01
- #define RIGHT_BUTTON 0x02
- #define CENTER_BUTTON 0x04
-
- int M_Gotmouse;
- int numbuttons;
- int M_CurX;
- int M_CurY;
- int M_CurButtons;
-
- void M_Init(void)
- {
- _AX=0;
- asm int 33h
- if(_AX==0xFFFF)
- {
- numbuttons=_BX;
- M_Gotmouse=1;
- }
- else M_Gotmouse=0;
- }
-
- void M_GetButtonPress(int mask)
- {
- if(!M_Gotmouse)return;
- _BX=0;
- while(!_BX&mask)
- {
- _AX=5;
- asm int 33h
- }
- M_CurButtons=_BX;
- M_CurX=_CX;
- M_CurY=_DX;
- }
-
- void M_GetCurPos(void)
- {
- if(!M_Gotmouse)return;
- _BX=0;
- _AX=3;
- asm int 33h
- M_CurButtons=_BX;
- M_CurX=_CX;
- M_CurY=_DX;
- }
-
- void M_ShowCursor(void)
- {
- if(!M_Gotmouse)return;
- _AX=1;
- asm int 33h
- }
-
- void M_HideCursor(void)
- {
- if(!M_Gotmouse)return;
- _AX=2;
- asm int 33h
- }
-
-